import 'package:flutter/material.dart';
import 'package:aio/aio.dart';
import 'package:myapp/src/route/ai/community/services/community_storage_service.dart';
import 'package:myapp/src/route/ai/game/game_menu_page.dart';
import 'package:myapp/src/route/ai/game/game_routes.dart';
import 'package:myapp/src/route/ai/game_20251114/apartment_game_routes.dart';
import 'package:shared_preferences/shared_preferences.dart';

import 'ai/community/pages/community_list_page.dart';
import 'driving/drviingtest.dart';
import 'ai/chat/ai_chat_page.dart';

///路由跳转
class AppRouteHelper extends LibRouteHelper {
  ///跳转驾考页面
  static void goDrvingTestRoute(BuildContext context) {
    LibRouteHelper.push(context, DrvingTestRoute());
  }

  ///跳转ai界面
  static void goAi(BuildContext context) {
    // LibRouteHelper.push(context, LoginPage());
    LibRouteHelper.push(context, AIChatPage());
    // LibRouteHelper.push(context, ThreeDGamePage());
    // LibRouteHelper.push(context, MinecraftGamePage());
    // GameRoutes.navigateToGameMenu(context);
    // LibRouteHelper.push(context, GameMenuPage());
  }

  ///跳转ai界面
  static void goGame(BuildContext context) {
    GameRoutes.navigateToGameMenu(context);
  }

  ///跳转小区管理界面
  static Future<void> goCommunityPage(BuildContext context) async {
    final prefs = await SharedPreferences.getInstance();
    final storageService = CommunityStorageService(prefs);
    LibRouteHelper.push(
        context, CommunityListPage(storageService: storageService));
  }

  ///跳转公寓游戏界面
  static void goApartmentGame(BuildContext context) {
    ApartmentGameRoutes.navigateToApartmentGame(context);
  }
}
